Dynamic experiments - multiple orientations

In [3]:
# Imports
import math as m
import numpy as np
import matplotlib.pyplot as plt
import holoviews as hv
import pylab as pl
from pylab import exp,cos,sin,pi,tan, pi
import pandas as pd
import seaborn as sb
import holoviews as hv
from IPython.display import SVG
import io
from PIL import Image
from random import random
import elastica as el
import elastica_neurons as en
from dynamics import *
%matplotlib inline
hv.notebook_extension()
/afs/inf.ed.ac.uk/user/s12/s1247380/Documents/HonoursProject/Python/venv/lib/python2.7/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
  "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
HoloViewsJS successfully loaded in this cell.
In [13]:
m = 11
n = 11
tau = 6
# Number of orientation selective neurons
nosn = 9
timesteps = 200
# for vonMises function
k = 0.25
A = 3


np.random.seed(67)
ac_orient4 = np.pi*np.random.rand(m,n)
ac_orient4[2:8,6] = np.random.rand(6)/5

oneColor()
visualField(ac_orient4)
Out[13]:
In [22]:
results, rs, direction, magnitude = runExperiment('el',m,n,nosn,ac_orient4,timesteps,tau,vis=True,el_factor=0.0001)
In [23]:
results
Out[23]:
In [24]:
t = np.arange(0,timesteps,1)

plotOneField((0,0),t,nosn,rs)
Out[24]:
In [15]:
ac_orient2 = np.pi/2*np.ones((m,n))
ac_orient2[5,5] = 0
visualField(ac_orient2)

timesteps = 400
In [16]:
results, rs, direction, magnitude = runExperiment('el',m,n,nosn,ac_orient2,timesteps,tau,vis=True,el_factor=0.0001)
In [17]:
results
Out[17]:
In [18]:
t = np.arange(0,timesteps,1)

plotOneField((0,0),t,nosn,rs)
Out[18]:
In [14]:
ac_orient3 = np.pi/2*np.ones((m,n))
for i in range(m):
    ac_orient3[i,i] = 3*np.pi/4
visualField(ac_orient3)
Out[14]:
In [9]:
results, rs, direction, magnitude = runExperiment('el',m,n,nosn,ac_orient3,timesteps,tau,vis=True,el_factor=0.0001)
In [12]:
t = np.arange(0,timesteps,1)

plotOneField((0,0),t,nosn,rs)
Out[12]:
In [11]:
results
Out[11]: